Data to be transmitted over a network typically is sent from an application to the protocol stack, a series of programs to transform the data into accordance with the standards for network transmissions. The data may be transformed into packets—small portions of the data with added headers. The protocol stack may turn over the packets to a network device driver. It, in turn, may transfer the packets to a communications adapter, a device providing an interface between a computing device and a communications link such as Ethernet cable.
A packet handed down to a network device driver by the protocol stack is typically composed of several linked buffers. These buffers include one or more header buffers, containing the network layer headers, and one or more payload buffers containing user data. To send a packet from the network device driver to the network adapter by direct memory access (DMA), the network device driver may either dynamically DMA map all the buffers or copy all the buffer pieces into a pre-mapped DMA buffer.
FIG. 4 illustrates a flowchart 400 of a prior-art method of transferring a packet from a protocol stack 405 to a network device driver 415, and from the network device driver 415 to a communications adapter 465. The protocol stack 405 requests from the network device driver 415 an interface-specific buffer (ISB), a form of pre-mapped DMA buffer (element 410). The network device driver 415 then returns an ISB (ISB 420) to the protocol stack 405. The protocol stack 405 then hands down the packet to the network device driver 415 (element 425). The packet is stored in two linked buffers, a non-ISB buffer 430 to store the header and the mapped ISB buffer 420. The network device driver 415 copies the header to mapped buffer 445 (element 440). Then, in separate operations, mapped buffer 445 and mapped ISB buffer 420 are DMAed to the communications adapter 465 (elements 455 and 460, respectively).